//
//  SenceCell.m
//  XDBaseFrameWork
//
//  Created by XD-XY on 10/23/14.
//  Copyright (c) 2014 XD-XY. All rights reserved.
//

#import "SenceCell.h"

@implementation SenceCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self initViews];
    }
    return self;
}

-(void)initViews
{
    self.backgroundColor =mClearColor;
    
    self.headIV = [UIImageView initImageViewRect:CGRectMake(24,10,57,57) andImage:nil andUserInteractionEnabled:YES];
    
    self.titleLB = [UILabel initLabelText:@"" andRect:CGRectMake(width_x(_headIV)+10,0,UI_SCREEN_WIDTH-(width_x(_headIV)+10)-23, 154/2.0f) andBackGroudColor:mClearColor andTextFont:[UIFont systemFontOfSize:18] andTextColor:UIColorFromRGB(0x6e6e6e) andTextAlignment:NSTextAlignmentRight];
    
    self.contentLB = [UILabel initLabelText:@"" andRect:CGRectMake(_titleLB.frame.origin.x,100/2.0f,UI_SCREEN_WIDTH-(width_x(_headIV)+10)-23, 15) andBackGroudColor:mClearColor andTextFont:[UIFont systemFontOfSize:13] andTextColor:UIColorFromRGB(0x7c7c7c) andTextAlignment:NSTextAlignmentRight];
    
    [self.contentView addSubview:_headIV];
    [self.contentView addSubview:_titleLB];
    [self.contentView addSubview:_contentLB];
    
    self.downline = [UIImageView initImageViewRect:CGRectMake(0, 154/2.0f-0.5, UI_SCREEN_WIDTH, 0.5) andImage:LOADIMAGE(@"xuxian_short@2x") andUserInteractionEnabled:YES];
    [self.contentView addSubview:_downline];
    
//    //cell未选中效果
//    self.disSelectBg = [[UIImageView alloc] init];
//    _disSelectBg.frame = CGRectMake(0, 0, self.frame.size.width,self.frame.size.height);
//    self.backgroundView = _disSelectBg;
    
    //cell选中效果
    self.selectBg = [[UIImageView alloc] init];
    _selectBg.frame = CGRectMake(0, 0, self.frame.size.width,self.frame.size.height);
    self.selectedBackgroundView = _selectBg;
}


-(void)setDataDict:(NSMutableDictionary *)dataDict
{
    if (_dataDict){
        _dataDict = nil;
    }
    _dataDict = [[NSMutableDictionary alloc] initWithDictionary:dataDict];
    _titleLB.text = _dataDict[@"SceneName"];
    _contentLB.text = _dataDict[@"SDesc"];
    
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
